package ru.ifmo.tanya.core.calls;

import ru.ifmo.tanya.core.huntgroups.HuntGroup;
import ru.ifmo.tanya.core.users.User;

import java.util.Date;


public class Call {

    private final int id;
    private final String caller;
    private final HuntGroup huntGroup;
    private final Date creationTime;
    private final User answerer;
    private final String whoFinished;

    private final Date answerTime;
    private final Date completionTime;

    public Call(int id,
                String caller,
                HuntGroup huntGroup,
                Date creationTime,
                User answerer,
                String whoFinished,
                Date answerTime,
                Date completionTime
    ) {
        this.id = id;
        this.caller = caller;
        this.huntGroup = huntGroup;
        this.creationTime = creationTime;
        this.answerer = answerer;
        this.whoFinished = whoFinished;
        this.answerTime = answerTime;
        this.completionTime = completionTime;
    }

    public int getId() {
        return id;
    }

    public String getCaller() {
        return caller;
    }

    public HuntGroup getHuntGroup() {
        return huntGroup;
    }

    public Date getCreationTime() {
        return creationTime;
    }

    public User getAnswerer() {
        return answerer;
    }

    public String getWhoFinished() {
        return whoFinished;
    }

    public Date getAnswerTime() {
        return answerTime;
    }

    public Date getCompletionTime() {
        return completionTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Call call = (Call) o;

        if (id != call.id) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return id;
    }
}
